'''
Created on Jan 30, 2012

@author: alebalbin
'''
def read_file(file):
    ifile=open(file)
    of=open(file.replace('.NA','.txt'),'w')
    for l in ifile:
        f=l.strip('\n').split('=')
        id=f[1]
        edge=id.split('-')
        if len(edge) > 1:
            print edge[0],edge[1]
            of.write(",".join(edge).replace(',','\t')+'\n')

file ='/Users/alebalbin/Desktop/nsclc_kras_dep/Data/scripts/pathway_commons/biopax.short_name.NA'
read_file(file)